package com.hb.函数式编程

import java.net.InetAddress

fun main() {

    /**
     * map函数接收一个,带参函数且有返回值的函数
     *
     */
    val list = listOf(1, 2, 3, 4, 5);
    val newList = list.map {
        it * 2 + 3
    }.forEach{
        println(it)
    }


    list.map {
        a-> a*2+3
    }.forEach(::println)

    list.map {
        println(it)
    }


    val addressList= listOf("127.0.0.1","127.0.0.2","127.0.0.3","127.0.0.4","127.0.0.5")
    addressList.map {
        InetAddress.getByName(it)
    }.forEach(::println)


}